import count from '@dfeidao/atom-nodejs/db/count';


interface Message {
	productid: string;
	role_allot_id: string;
	group_id: string;
}

export default async function atom(msg: Message, action_id: string, session_id: string, spaceid: string) {
	const systemid = '12';
	const { exec, prepare } = count(action_id, session_id, systemid);
	const productid = msg.productid;
	const role_allot_id = msg.role_allot_id;
	const group_id = msg.group_id;
	prepare('allot_conditions_group', { productid, role_allot_id, parent_group_id: group_id });
	const [t] = await exec();

	return t;
}
